package com.medical.manage.controller;

import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;

import com.medical.common.core.utils.poi.ExcelUtil;

import com.medical.manage.domain.DepartmentManagement;

import com.medical.manage.domain.MedicalPatient;
import com.medical.manage.service.IDepartmentManagementService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import com.medical.common.security.annotation.RequiresPermissions;

import com.medical.common.core.web.controller.BaseController;
import com.medical.common.core.domain.Result;
import com.medical.common.core.web.page.TableDataInfo;

/**
 * 科室管理Controller
 *
 * @author medical
 * @date 2024-07-21
 */
@RestController
@RequestMapping("/management")
public class DepartmentManagementController extends BaseController
{
    @Autowired
    private IDepartmentManagementService departmentManagementService;

    /**
     * 查询患者列表
     * @param medicalPatient
     * @return
     */
    @GetMapping("patientList")
    public Result<TableDataInfo> list(MedicalPatient medicalPatient){
        startPage();
        List<MedicalPatient> list = departmentManagementService.list(medicalPatient);
        return getDataTable(list);
    }

    @GetMapping("/patient/{patientName}")
    private Result patientList(@PathVariable("patientName")String patientName){
        return success(departmentManagementService.patientList(patientName));
    }

    @GetMapping("/diagnostic/{patientName}")
    private Result diagnosticList(@PathVariable("patientName")String patientName){
        return success(departmentManagementService.diagnosticList(patientName));
    }
}
